package com.example.zzh.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.zzh.entity.ZzhDepotHead;
import com.example.zzh.entity.ZzhOrder;
import com.example.zzh.mapper.ZzhDepotHeadMapper;
import com.example.zzh.service.ZzhDepotHeadService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;

/**
 * <p>
 * 单据主表 服务实现类
 * </p>
 *
 * @author zzh
 * @since 2023-08-21
 */
@Service
public class ZzhDepotHeadServiceImpl extends ServiceImpl<ZzhDepotHeadMapper, ZzhDepotHead> implements ZzhDepotHeadService {
    @Resource
    private ZzhDepotHeadMapper zzhDepotHeadMapper;

    @Override
    public IPage pageName(Page<ZzhOrder> page) {
        return zzhDepotHeadMapper.pageName(page);
    }

    @Override
    public IPage pageNames(Page<ZzhOrder> page, Wrapper wrapper) {
        return zzhDepotHeadMapper.pageNames(page,wrapper);
    }

    @Override
    public Long saveDepotHead(ZzhDepotHead zzhDepotHead) {
        return zzhDepotHeadMapper.saveDepotHead(zzhDepotHead);
    }

    @Override
    public Long selectId(String number) {
        return zzhDepotHeadMapper.selectId(number);
    }

    @Override
    public IPage pageNumber(Page<ZzhOrder> page, HashMap<String, Object> hashMap) {
        return zzhDepotHeadMapper.pageNumber(page,hashMap);
    }

    @Override
    public ZzhDepotHead selectDepotHead(String linkNumber) {
        return zzhDepotHeadMapper.selectDepotHead(linkNumber);
    }

    @Override
    public int selectNumber(String start, String end, String subType) {
        if(zzhDepotHeadMapper.selectNumber(start,end,subType)==null){
            return 0;
        }else {
            return zzhDepotHeadMapper.selectNumber(start,end,subType);
        }
    }

    @Override
    public int selectMoney(String start, String end, String subType) {
        if(zzhDepotHeadMapper.selectMoney(start,end,subType)==null){
            return 0;
        }else {
            return zzhDepotHeadMapper.selectMoney(start,end,subType);
        }
    }


//    @Override
//    public ZzhOrder getById(int id) {
//        return zzhDepotHeadMapper.selectById(id);
//    }
}
